cargo.git
8 years agoAuto merge of #3956 - jessicah:update-num-cpus-dep, r=alexcrichton
bors [Wed, 26 Apr 2017 03:32:21 +0000 (03:32 +0000)]
Auto merge of #3956 - jessicah:update-num-cpus-dep, r=alexcrichton

Update num_cpus to 1.4.0 (adds support for Haiku)

This will bring it inline with rustc: https://github.com/rust-lang/rust/pull/41552

8 years agoUpdate num_cpus to 1.4.0 (adds support for Haiku)
Jessica Hamilton [Wed, 26 Apr 2017 03:29:44 +0000 (15:29 +1200)]
Update num_cpus to 1.4.0 (adds support for Haiku)

8 years agoAuto merge of #3953 - jessicah:haiku-renaming-fix, r=alexcrichton
bors [Tue, 25 Apr 2017 15:59:59 +0000 (15:59 +0000)]
Auto merge of #3953 - jessicah:haiku-renaming-fix, r=alexcrichton

Haiku: skip renaming if filenames are the same

8 years agoHaiku: skip renaming if filenames are the same
Jessica Hamilton [Tue, 25 Apr 2017 23:15:41 +0000 (23:15 +0000)]
Haiku: skip renaming if filenames are the same

8 years agoHaiku: doesn't have SIG_SYS
Jessica Hamilton [Tue, 25 Apr 2017 16:49:09 +0000 (16:49 +0000)]
Haiku: doesn't have SIG_SYS

8 years agoHaiku: use LIBRARY_PATH in configure
Jessica Hamilton [Tue, 25 Apr 2017 16:48:26 +0000 (16:48 +0000)]
Haiku: use LIBRARY_PATH in configure

8 years agoAuto merge of #3952 - jessicah:haiku-support, r=alexcrichton
bors [Tue, 25 Apr 2017 05:36:08 +0000 (05:36 +0000)]
Auto merge of #3952 - jessicah:haiku-support, r=alexcrichton

Haiku support

8 years agoAuto merge of #3948 - alexcrichton:update-deps, r=alexcrichton
bors [Mon, 24 Apr 2017 19:11:49 +0000 (19:11 +0000)]
Auto merge of #3948 - alexcrichton:update-deps, r=alexcrichton

Update dependencies in Cargo.lock

This also fixes a few CVEs reported with libcurl and libgit2, so pulling in those updates.

8 years agoAuto merge of #3901 - BenWiederhake:all-kinds, r=alexcrichton
bors [Mon, 24 Apr 2017 17:11:58 +0000 (17:11 +0000)]
Auto merge of #3901 - BenWiederhake:all-kinds, r=alexcrichton

Implementation and CLI-support for `--all-$KIND` flags

This implements #3112.

This means all of the following commands are now possible and meaningful:
```
cargo build --all-bins
cargo build --all-tests
cargo test --all-tests
cargo test --all-bins
cargo check --all-bins --all-examples --all-tests --all-benches
```

The commits try to represent the incremental "propagation" of the new feature:
- core functionality (`cargo check --lib` passes)
- CLI suport (`cargo build` passes)
- additional tests (`cargo test` covers new functionality)

Note that `--all` is already reserved to mean "all packages of the workspace", so it can't be used to mean `--all-bins --all-examples --all-tests --all-benches`.

I intend to follow this up by some other PRs, so please do tell me where I could improve.

8 years agoUpdate dependencies in Cargo.lock
Alex Crichton [Mon, 24 Apr 2017 14:00:07 +0000 (07:00 -0700)]
Update dependencies in Cargo.lock

8 years agoAuto merge of #3942 - aidanhs:aphs-no-interactive, r=alexcrichton
bors [Sun, 23 Apr 2017 16:45:47 +0000 (16:45 +0000)]
Auto merge of #3942 - aidanhs:aphs-no-interactive, r=alexcrichton

Remove docker flags that can cause issues

See rust-lang/rust#39036

8 years agoRemove docker flags that can cause issues (rust-lang/rust#39036)
Aidan Hobson Sayers [Sun, 23 Apr 2017 16:08:18 +0000 (17:08 +0100)]
Remove docker flags that can cause issues (rust-lang/rust#39036)

8 years agoAuto merge of #3887 - luser:rustc-wrapper, r=alexcrichton
bors [Wed, 19 Apr 2017 02:19:25 +0000 (02:19 +0000)]
Auto merge of #3887 - luser:rustc-wrapper, r=alexcrichton

Add support for wrapping cargo's rustc invocations by setting RUSTC_WRAPPER

To use sccache for cargo builds we need a simple way to get sccache into the rustc commandline when cargo invokes rustc. Currently this is only possible by hard-linking or copying the `sccache` binary to be named `rustc` and then either setting `RUSTC` to its path or putting it first in `$PATH`, both of which are sort of clunky and require manual steps even if installing sccache via `cargo install`.

This patch adds support for a `RUSTC_WRAPPER` environment variable which, if set, will simply be inserted as the actual binary for all rustc process execution, with rustc and all other rustc arguments following.

I didn't add any tests for this, I couldn't figure out the right place to put them, and presumably we'd need to build a helper binary of some sort to use as the wrapper. If you've got suggestions for how to do that properly I'd be happy to write tests.

This works well in my local testing:
```
luser@eye7:/build/read-process-memory$ /build/cargo/target/release/cargo clean; time RUSTC_WRAPPER=/build/sccache2/target/release/sccache RUSTC=/home/luser/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/rustc /build/cargo/target/release/cargo build
   Compiling getopts v0.2.14
   Compiling log v0.3.6
   Compiling libc v0.2.16
   Compiling rand v0.3.14
   Compiling pulldown-cmark v0.0.3
   Compiling tempdir v0.3.5
   Compiling skeptic v0.5.0
   Compiling read-process-memory v0.1.2-pre (file:///build/read-process-memory)
    Finished dev [unoptimized + debuginfo] target(s) in 7.31 secs

real 0m7.733s
user 0m0.060s
sys 0m0.036s
luser@eye7:/build/read-process-memory$ /build/cargo/target/release/cargo clean; time RUSTC_WRAPPER=/build/sccache2/target/release/sccache RUSTC=/home/luser/.rustup/toolchains/beta-x86_64-unknown-linux-gnu/bin/rustc /build/cargo/target/release/cargo build
   Compiling getopts v0.2.14
   Compiling libc v0.2.16
   Compiling log v0.3.6
   Compiling pulldown-cmark v0.0.3
   Compiling rand v0.3.14
   Compiling tempdir v0.3.5
   Compiling skeptic v0.5.0
   Compiling read-process-memory v0.1.2-pre (file:///build/read-process-memory)
    Finished dev [unoptimized + debuginfo] target(s) in 0.97 secs

real 0m1.049s
user 0m0.060s
sys 0m0.036s
```

The use of beta rustc is just to pick up the fix for making `--emit=dep-info` faster (which should ship in 1.17). If this patch ships in cargo then in the future developers should simply be able to `cargo install sccache; export RUSTC_WRAPPER=sccache` and `cargo build` as normal, but benefit from local sccache caching.

8 years agoAuto merge of #3926 - froydnj:reenable-nightly-tests, r=alexcrichton
bors [Tue, 18 Apr 2017 13:54:28 +0000 (13:54 +0000)]
Auto merge of #3926 - froydnj:reenable-nightly-tests, r=alexcrichton

re-enable previously nightly-only tests

These tests all play nicely with Rust 1.16.

8 years agore-enable previously nightly-only tests
Nathan Froyd [Sat, 15 Apr 2017 01:55:41 +0000 (21:55 -0400)]
re-enable previously nightly-only tests

These tests all play nicely with Rust 1.16.

8 years agoAdd support for wrapping cargo's rustc invocations by setting RUSTC_WRAPPER
Ted Mielczarek [Fri, 31 Mar 2017 16:39:19 +0000 (12:39 -0400)]
Add support for wrapping cargo's rustc invocations by setting RUSTC_WRAPPER

8 years agoAuto merge of #3928 - andwur:version-not-found-error-msgs, r=alexcrichton
bors [Tue, 18 Apr 2017 06:12:37 +0000 (06:12 +0000)]
Auto merge of #3928 - andwur:version-not-found-error-msgs, r=alexcrichton

Better error message when a package version is not found

This changes the error message when a package *is* found but there's no
matching version to be a little more helpful.

Old: "no matching package named `<dep name>`"
New: "no matching version `<version>` found for package `<dep name>`"

Fixes #2997

8 years agoAuto merge of #3924 - koivunej:issue_3922, r=alexcrichton
bors [Tue, 18 Apr 2017 04:26:49 +0000 (04:26 +0000)]
Auto merge of #3924 - koivunej:issue_3922, r=alexcrichton

Adjust submodule updating failure reporting

This PR changes output of cargo when updating a dependency fails because of it's submodules cannot be loaded. In my original example this was caused by submodule pointing to a revision which was deleted by force pushing. Fixes #3922.

Before:

```
$ cargo check
    Updating git repository `<foo-url>`
error: failed to load source for a dependency on `foo`
Caused by:
  Unable to update <foo-url>?rev=hash
To learn more, run the command again with --verbose.
```

After:

```
$ cargo check
    Updating git repository `<foo-url>`
error: failed to load source for a dependency on `foo`
Caused by:
  Unable to update <foo-url>?rev=hash
Caused by:
  Failed to update submodule `submodule`
To learn more, run the command again with --verbose.
```

`--verbose` showing an additional `[9/-3] object not found - no match for id (hash)` has not been changed.

@alexcrichton since we have this nice timezone difference there was no chance of mentoring so far but any comments/suggestions are highly welcome. I'll likely check back on this next week.

8 years agoAuto merge of #3908 - froydnj:overflow-checks, r=alexcrichton
bors [Tue, 18 Apr 2017 02:52:17 +0000 (02:52 +0000)]
Auto merge of #3908 - froydnj:overflow-checks, r=alexcrichton

add `overflow-checks` field to profiles

...and pass `-C overflow-checks` to the compiler when necessary.

Fixes #2262.

8 years agoAuto merge of #3930 - alexcrichton:more-clean, r=alexcrichton
bors [Tue, 18 Apr 2017 01:16:05 +0000 (01:16 +0000)]
Auto merge of #3930 - alexcrichton:more-clean, r=alexcrichton

Clean some more env vars during tests

Will be required to run tests as part of rust-lang/rust

8 years agoClean some more env vars during tests
Alex Crichton [Tue, 18 Apr 2017 00:55:59 +0000 (17:55 -0700)]
Clean some more env vars during tests

Will be required to run tests as part of rust-lang/rust

8 years agoFix #2997: error message when version not found could be improved
Andrew Watts [Mon, 17 Apr 2017 12:24:56 +0000 (21:54 +0930)]
Fix #2997: error message when version not found could be improved

This changes the error message when a package *is* found but there's no
matching version to be a little more helpful.

Old: "no matching package named `...`"
New: "no matching version `...` found for package `...`"

8 years agogit: use lower case in error message
Joonas Koivunen [Mon, 17 Apr 2017 12:08:51 +0000 (15:08 +0300)]
git: use lower case in error message

8 years agoadd `overflow-checks` field to profiles
Nathan Froyd [Fri, 7 Apr 2017 16:32:42 +0000 (12:32 -0400)]
add `overflow-checks` field to profiles

...and pass `-C overflow-checks` to the compiler when necessary.

Fixes #2262.

8 years agostyle fixes
Joonas Koivunen [Fri, 14 Apr 2017 07:55:26 +0000 (10:55 +0300)]
style fixes

8 years agogit: adjust error on submodule update failure
Joonas Koivunen [Fri, 14 Apr 2017 05:38:55 +0000 (08:38 +0300)]
git: adjust error on submodule update failure

Now instead of reporting single generic "submodule update failed" a
dependency specific submodule update failed error message will be
reported and shown without --verbose.

8 years agogit: refactor update_submodule out of loop
Joonas Koivunen [Fri, 14 Apr 2017 05:38:36 +0000 (08:38 +0300)]
git: refactor update_submodule out of loop

8 years agoreproduce error msg in test case
Joonas Koivunen [Fri, 14 Apr 2017 03:58:02 +0000 (06:58 +0300)]
reproduce error msg in test case

8 years agoAuto merge of #3919 - malbarbo:openssl-probe, r=alexcrichton
bors [Wed, 12 Apr 2017 22:28:57 +0000 (22:28 +0000)]
Auto merge of #3919 - malbarbo:openssl-probe, r=alexcrichton

Update openssl-probe to 0.1.1

This helps find ssl certificates on termux (android).

8 years agoAuto merge of #3885 - malbarbo:android-build, r=alexcrichton
bors [Wed, 12 Apr 2017 20:24:43 +0000 (20:24 +0000)]
Auto merge of #3885 - malbarbo:android-build, r=alexcrichton

Add android build support

This add android build support, including openssl.

8 years agoUpdate openssl-probe to 0.1.1
Marco A L Barbosa [Wed, 12 Apr 2017 19:49:53 +0000 (16:49 -0300)]
Update openssl-probe to 0.1.1

8 years agoAuto merge of #3847 - SergioBenitez:master, r=alexcrichton
bors [Wed, 12 Apr 2017 19:03:16 +0000 (19:03 +0000)]
Auto merge of #3847 - SergioBenitez:master, r=alexcrichton

Always emit build script warnings for crates that fail to build

Resolves #3777.

r? @alexcrichton

8 years agoRemove android build for aarch64, arm and i686
Marco A L Barbosa [Tue, 11 Apr 2017 20:26:22 +0000 (17:26 -0300)]
Remove android build for aarch64, arm and i686

8 years agoAdd android build to travis
Marco A L Barbosa [Thu, 30 Mar 2017 23:15:48 +0000 (20:15 -0300)]
Add android build to travis

8 years agoAdd android Dockerfile
Marco A L Barbosa [Thu, 30 Mar 2017 23:08:54 +0000 (20:08 -0300)]
Add android Dockerfile

8 years agoAdd openssl build support for android
Marco A L Barbosa [Thu, 30 Mar 2017 23:06:54 +0000 (20:06 -0300)]
Add openssl build support for android

8 years agoAuto merge of #3914 - jwilm:specifying-dependencies-replace-note, r=alexcrichton
bors [Mon, 10 Apr 2017 20:40:50 +0000 (20:40 +0000)]
Auto merge of #3914 - jwilm:specifying-dependencies-replace-note, r=alexcrichton

Add note about Cargo.lock behavior with [replace]

The Cargo.lock behavior when using [replace] can be misleading if one
does not expect multiple versions of the crate to be included. This note
is intended to assure users that this behavior is expected, and it
suggests a way to verify their `[replace]` override is preferred.

I ran into this issue and ended up bugging @alexcrichton about it. Hopefully including this will reduce the support burden on cargo devs :smile:.

8 years agoAdd note about Cargo.lock behavior with [replace]
Joe Wilm [Mon, 10 Apr 2017 20:24:31 +0000 (13:24 -0700)]
Add note about Cargo.lock behavior with [replace]

The Cargo.lock behavior when using [replace] can be misleading if one
does not expect multiple versions of the crate to be included. This note
is intended to assure users that this behavior is expected, and it
suggests a way to verify their `[replace]` override is preferred.

8 years agoAllKinds tests: interoperability with '--all'
Ben Wiederhake [Mon, 10 Apr 2017 18:18:08 +0000 (20:18 +0200)]
AllKinds tests: interoperability with '--all'

8 years agoAllKinds tests: cargo-test
Ben Wiederhake [Wed, 5 Apr 2017 19:48:15 +0000 (21:48 +0200)]
AllKinds tests: cargo-test

8 years agoAllKinds tests: cargo-bench, cargo-build
Ben Wiederhake [Wed, 5 Apr 2017 18:50:22 +0000 (20:50 +0200)]
AllKinds tests: cargo-bench, cargo-build

8 years agoAllKinds tests: cargo-run
Ben Wiederhake [Fri, 24 Mar 2017 20:20:38 +0000 (21:20 +0100)]
AllKinds tests: cargo-run

8 years agoAsk for filter specifity instead of 'match'
Ben Wiederhake [Fri, 24 Mar 2017 21:21:29 +0000 (22:21 +0100)]
Ask for filter specifity instead of 'match'

8 years agoAdapt binaries to new cargo_compile API
Ben Wiederhake [Fri, 24 Mar 2017 08:28:35 +0000 (09:28 +0100)]
Adapt binaries to new cargo_compile API

Closes #3112.

8 years agoExtend Compile API to handle flags like --tests and --bins
Ben Wiederhake [Thu, 23 Mar 2017 22:45:23 +0000 (23:45 +0100)]
Extend Compile API to handle flags like --tests and --bins

8 years agoAuto merge of #3909 - JanLikar:fix/3876, r=alexcrichton
bors [Mon, 10 Apr 2017 14:42:41 +0000 (14:42 +0000)]
Auto merge of #3909 - JanLikar:fix/3876, r=alexcrichton

Improve "dirty" error message

Improve the error message stating the working directory has dirty files (files not yet committed).

Fix #3876.

8 years agoImprove "dirty" error message
Jan Likar [Sun, 9 Apr 2017 02:20:41 +0000 (04:20 +0200)]
Improve "dirty" error message

Improve the error message stating the working directory has dirty
files (files not yet committed).

Fix #3876.

8 years agoAlways emit build script warnings for crates that fail to build
Sergio Benitez [Sun, 19 Mar 2017 02:33:09 +0000 (19:33 -0700)]
Always emit build script warnings for crates that fail to build

Resolves #3777

8 years agoAuto merge of #3907 - waywardmonkeys:show-default-new, r=alexcrichton
bors [Sat, 8 Apr 2017 23:07:02 +0000 (23:07 +0000)]
Auto merge of #3907 - waywardmonkeys:show-default-new, r=alexcrichton

Indicate that --lib is default for new, init.

I often forget for a moment which is the default behavior: `--bin` or `--lib`. This makes it clear in the usage text.

8 years agoAuto merge of #3904 - tee-too:fix-3880, r=alexcrichton
bors [Sat, 8 Apr 2017 21:29:11 +0000 (21:29 +0000)]
Auto merge of #3904 - tee-too:fix-3880, r=alexcrichton

Sort tests so that unit tests are run before integration tests

Fix #3880

8 years agoAuto merge of #3906 - waywardmonkeys:typo-fixes, r=alexcrichton
bors [Sat, 8 Apr 2017 19:53:03 +0000 (19:53 +0000)]
Auto merge of #3906 - waywardmonkeys:typo-fixes, r=alexcrichton

Fix typos.

8 years agoIndicate that --lib is default for new, init.
Bruce Mitchener [Fri, 7 Apr 2017 09:37:34 +0000 (16:37 +0700)]
Indicate that --lib is default for new, init.

8 years agoFix typos.
Bruce Mitchener [Fri, 7 Apr 2017 09:32:11 +0000 (16:32 +0700)]
Fix typos.

8 years agoSort tests so that unit tests are run before integration tests
tee-too [Thu, 6 Apr 2017 14:18:07 +0000 (16:18 +0200)]
Sort tests so that unit tests are run before integration tests

Fix #3880

8 years agoAuto merge of #3898 - jmatraszek:fix_rust_40955, r=alexcrichton
bors [Wed, 5 Apr 2017 23:36:04 +0000 (23:36 +0000)]
Auto merge of #3898 - jmatraszek:fix_rust_40955, r=alexcrichton

Fix rust-lang/rust 40955

Proposed fix for rust-lang/rust#40955.

I could also work on adding some additional tests, so we have all cases covered and automatically tested.

8 years agoTouch up line lengths
Alex Crichton [Wed, 5 Apr 2017 23:35:39 +0000 (16:35 -0700)]
Touch up line lengths

8 years agoFix rust 40955
Jakub Matraszek [Tue, 4 Apr 2017 21:58:31 +0000 (23:58 +0200)]
Fix rust 40955

8 years agoAuto merge of #3854 - tee-too:fix-3499, r=alexcrichton
bors [Tue, 4 Apr 2017 18:01:01 +0000 (18:01 +0000)]
Auto merge of #3854 - tee-too:fix-3499, r=alexcrichton

Add `[target.'cfg(...)']` syntax for rustc(doc)flags in .cargo/config

Allow to use the Rust `cfg(...)` syntax to configure rust(doc)flags.
The flags are concatenated when a build matches several `cfg`, or
several `cfg` and a $triple.

Fix #3499.

8 years agoAdd `[target.'cfg(...)']` syntax for rustc(doc)flags in .cargo/config
tee-too [Mon, 3 Apr 2017 18:35:23 +0000 (20:35 +0200)]
Add `[target.'cfg(...)']` syntax for rustc(doc)flags in .cargo/config

Allow to use the Rust `cfg(...)` syntax to configure rust(doc)flags.
The flags are concatenated when a build matches several `cfg`, or
several `cfg` and a $triple.

Fix #3499.

8 years agoAuto merge of #3893 - nrc:config-values, r=alexcrichton
bors [Mon, 3 Apr 2017 22:30:12 +0000 (22:30 +0000)]
Auto merge of #3893 - nrc:config-values, r=alexcrichton

Allow a client to override values in a config

The use case here is that the RLS wants to set a project's `target-dir`, but can't do this using a config file (since the user might have their own, and it's a bit hacky) or via an environment variable (because there might be multiple instances of Cargo running on different directories in different threads.

ISTM that the best way to accomplish this is to allow the RLS to override values in the config before we make a workspace from it. However, since the config uses a `LazyCell` for the config values, this is not very nice (if something tries to read a config value before we set them, then there will be an error when we try to set them). However, this meets our needs and is pretty low impact, so it seems like the best solution for now. I'm open to other ideas though.

8 years agoAllow a client to override values in a config
Nick Cameron [Mon, 3 Apr 2017 02:08:15 +0000 (14:08 +1200)]
Allow a client to override values in a config

9 years agoAuto merge of #3842 - pwoolcoc:add-pijul-vcs-support, r=alexcrichton
bors [Sat, 1 Apr 2017 06:32:23 +0000 (06:32 +0000)]
Auto merge of #3842 - pwoolcoc:add-pijul-vcs-support, r=alexcrichton

Add Pijul support to Cargo

[Pijul](https://pijul.org) is a version control system written in Rust. This commit adds the ability to create a cargo project using pijul as the vcs for the project.

To use it, run `cargo new my-awesome-project --vcs=pijul`

9 years agoAuto merge of #3889 - alexcrichton:toml-fix, r=alexcrichton
bors [Sat, 1 Apr 2017 01:48:01 +0000 (01:48 +0000)]
Auto merge of #3889 - alexcrichton:toml-fix, r=alexcrichton

Update toml to fix a regression in backcompat

Related to rust-lang/rust#40956

9 years agoUpdate toml to fix a regression in backcompat
Alex Crichton [Sat, 1 Apr 2017 01:45:55 +0000 (18:45 -0700)]
Update toml to fix a regression in backcompat

Related to rust-lang/rust#40956

9 years agoAdd Pijul support to cargo
Paul Woolcock [Fri, 31 Mar 2017 15:35:58 +0000 (11:35 -0400)]
Add Pijul support to cargo

[Pijul](https://pijul.org) is a version control system written in Rust. This commit adds the ability to create a cargo project using pijul as the vcs for the project.

To use it, run `cargo new my-awesome-project --vcs=pijul`

9 years agoAuto merge of #3878 - ehiggs:revert-template-until-after-rfc, r=alexcrichton
bors [Fri, 31 Mar 2017 15:50:19 +0000 (15:50 +0000)]
Auto merge of #3878 - ehiggs:revert-template-until-after-rfc, r=alexcrichton

Revert template until after rfc

As discussed in #3860, templates was merged without going through the RFC process. @ssokolow has raised some useful comments which need to be settled before the template system can be put back in.

#3859 was another relevant issue.

9 years agoAuto merge of #3875 - matklad:unused-replace, r=alexcrichton
bors [Thu, 30 Mar 2017 18:10:07 +0000 (18:10 +0000)]
Auto merge of #3875 - matklad:unused-replace, r=alexcrichton

Fix false positive about unused replace

closes #3861
@chriscoomber thanks for the great repro!

9 years agoAuto merge of #3879 - jbendig:issue_3867, r=alexcrichton
bors [Thu, 30 Mar 2017 15:25:03 +0000 (15:25 +0000)]
Auto merge of #3879 - jbendig:issue_3867, r=alexcrichton

Fix `cargo run` panic when required-features not satisfied

This PR fixes #3867 which is made up of two parts.

The first part involves `cargo run` triggering an assertion after compiling. This is triggered by the single binary selected for compilation being filtered out when required-features is specified and said features are not enabled. The cleanest approach to me involves just sticking a flag into `CompileFilter::Everything`. The flag then triggers the already existing error message when required-features is not satisfied. I think this works best because it localizes what is really a `cargo run` quirk without requiring any boilerplate or duplicate code.

The second part shows `cargo run` bailing when two binaries exist, both with required-features, but only one is resolved to be compiled due to default features. I feel like the current approach is correct because it's consistent with what normally happens when there are multiple binaries. I'm open to changing this, but for now, I've added a test to enforce this behavior.

cc @BenWiederhake: I took a quick peek at your branch to fix #3112 and I noticed that it probably won't merge cleanly with this PR. Just an FYI in case it makes sense to have this merged.

9 years agoFix `cargo run` panic when required-features not satisfied
James Bendig [Wed, 29 Mar 2017 20:48:43 +0000 (15:48 -0500)]
Fix `cargo run` panic when required-features not satisfied

Fixes #3867

9 years agoCleanup of template patch reversion.
Ewan Higgs [Wed, 29 Mar 2017 20:23:46 +0000 (22:23 +0200)]
Cleanup of template patch reversion.

9 years agoRevert "Cargo templating for `new` and `init`"
Ewan Higgs [Wed, 29 Mar 2017 19:57:33 +0000 (21:57 +0200)]
Revert "Cargo templating for `new` and `init`"

This reverts commit 875a8aba7916b63c3c8464008a271f6082e23779.

9 years agoRevert "Upgrade handlebars to 0.25."
Ewan Higgs [Wed, 29 Mar 2017 19:54:39 +0000 (21:54 +0200)]
Revert "Upgrade handlebars to 0.25."

This reverts commit 0aad658f09590396b4c7fe6ce93eae322354fd06.

9 years agoRevert "Fix for #3722"
Ewan Higgs [Wed, 29 Mar 2017 19:52:23 +0000 (21:52 +0200)]
Revert "Fix for #3722"

This reverts commit 7e80c684cad3249923b05ecbe02c009b111d9b9f.

9 years agoRevert "Use time crate directly to get the year"
Ewan Higgs [Wed, 29 Mar 2017 19:51:50 +0000 (21:51 +0200)]
Revert "Use time crate directly to get the year"

This reverts commit 47221e98189daa34e47934d44223db12db84c7b9.

9 years agoRevert "Add year to project template variables"
Ewan Higgs [Wed, 29 Mar 2017 19:50:53 +0000 (21:50 +0200)]
Revert "Add year to project template variables"

This reverts commit 69ffd99f4261b10414b882eed638f041e42d8f73.

9 years agoFix false positive about unused replace
Aleksey Kladov [Wed, 29 Mar 2017 09:58:45 +0000 (12:58 +0300)]
Fix false positive about unused replace

9 years agoAuto merge of #3869 - matklad:test-isolation, r=alexcrichton
bors [Mon, 27 Mar 2017 13:51:57 +0000 (13:51 +0000)]
Auto merge of #3869 - matklad:test-isolation, r=alexcrichton

Don't read ~/.cargo/config in tests

Closes #3863

r? @alexcrichton

9 years agoDon't read ~/.cargo/config in tests
Aleksey Kladov [Sat, 25 Mar 2017 11:17:51 +0000 (14:17 +0300)]
Don't read ~/.cargo/config in tests

Closes #3863

9 years agoAuto merge of #3865 - matklad:doc-all-the-things, r=alexcrichton
bors [Sat, 25 Mar 2017 02:22:06 +0000 (02:22 +0000)]
Auto merge of #3865 - matklad:doc-all-the-things, r=alexcrichton

Beef up docs about integrating Cargo with other stuff

Add info about `--message-format=json`, `--dep-info` and custom cargo subcommands (mostly copy-pasted from the wiki :) ).

cc @carols10cents

r? @alexcrichton

9 years agoAdd external-tools.md to the Makefile
Aleksey Kladov [Fri, 24 Mar 2017 22:46:36 +0000 (01:46 +0300)]
Add external-tools.md to the Makefile

9 years agoAuto merge of #3862 - matklad:crate-types, r=alexcrichton
bors [Fri, 24 Mar 2017 15:04:47 +0000 (15:04 +0000)]
Auto merge of #3862 - matklad:crate-types, r=alexcrichton

Fix crate_types in serialized targets

closes #3840

9 years agoBeef up docs about integrating Cargo with other stuff
Aleksey Kladov [Fri, 24 Mar 2017 09:11:43 +0000 (12:11 +0300)]
Beef up docs about integrating Cargo with other stuff

9 years agoFix crate_types in serialized targets
Aleksey Kladov [Fri, 24 Mar 2017 07:40:12 +0000 (10:40 +0300)]
Fix crate_types in serialized targets

9 years agoAuto merge of #3857 - antonlarin:rebuild-on-env-change, r=alexcrichton
bors [Thu, 23 Mar 2017 23:26:55 +0000 (23:26 +0000)]
Auto merge of #3857 - antonlarin:rebuild-on-env-change, r=alexcrichton

Include package props with corresponding env vars into target metadata

Previously, when changing package properties with corresponding environment variables (such as authors, which has CARGO_PKG_AUTHORS), it didn't invalidate the build, even though there could have been a dependency on such variables in the source code.

This commit includes 3 such properties: authors list, description and homepage in the target metadata.

I've added a test only for description change, can add more if necessary.
Fixes #3696.

9 years agoAuto merge of #3837 - alexcrichton:workspace-exlucde, r=brson
bors [Thu, 23 Mar 2017 21:56:53 +0000 (21:56 +0000)]
Auto merge of #3837 - alexcrichton:workspace-exlucde, r=brson

Add a workspace.exclude key

This commit adds a new key to the `Cargo.toml` manifest, `workspace.exclude`.
This new key is a list of strings which is an array of directories that are
excluded from the workspace explicitly. This is intended for use cases such as
vendoring where path dependencies into a vendored directory don't want to pull
in the workspace dependencies.

There's a number of use cases mentioned on #3192 which I believe should all be
covered with this strategy. At a bare minimum it should suffice to `exclude`
every directory and then just explicitly whitelist crates through `members`
through inclusion, and that should give precise control over the structure of a
workspace.

Closes #3192

9 years agoInclude package props with env vars into target metadata
Anton Larin [Thu, 23 Mar 2017 14:26:40 +0000 (17:26 +0300)]
Include package props with env vars into target metadata

Previously, when changing package properties with corresponding
environment variables (such as authors, which has CARGO_PKG_AUTHORS),
it didn't invalidate the build, even though there could have been
a dependency on such variables in the source code.

This commit includes such properties (there are 3 of them in total:
authors, description and homepage) in the target metadata.

Fixes #3696.

9 years agoAuto merge of #3858 - alexcrichton:fix-ci, r=alexcrichton
bors [Thu, 23 Mar 2017 15:28:45 +0000 (15:28 +0000)]
Auto merge of #3858 - alexcrichton:fix-ci, r=alexcrichton

Attempt to fix CI

Travis looks to have switched to rustup.rs

9 years agoAttempt to fix CI
Alex Crichton [Thu, 23 Mar 2017 15:10:58 +0000 (08:10 -0700)]
Attempt to fix CI

Travis looks to have switched to rustup.rs

9 years agoAuto merge of #3841 - matklad:encourage-explicit-version, r=alexcrichton
bors [Tue, 21 Mar 2017 13:50:59 +0000 (13:50 +0000)]
Auto merge of #3841 - matklad:encourage-explicit-version, r=alexcrichton

Encourage tools writers to explicitly pin metadata version

We do support versioning of metadata, but let's encourage tool's writers to actually use it.

They might not realize that this flag exists at all, or they can be too lazy (like myself :( ) to use it.

We can also make this flag mandatory, but I think that's a little bit to far.

9 years agoAuto merge of #3848 - tee-too:fix-2529, r=alexcrichton
bors [Mon, 20 Mar 2017 22:10:08 +0000 (22:10 +0000)]
Auto merge of #3848 - tee-too:fix-2529, r=alexcrichton

Report the name of the test that failed (fix #2529)

Fix #2529

9 years agoAuto merge of #3849 - alexcrichton:fix-stack-overflow, r=matklad
bors [Mon, 20 Mar 2017 20:39:33 +0000 (20:39 +0000)]
Auto merge of #3849 - alexcrichton:fix-stack-overflow, r=matklad

Detect cyclic dependencies through [replace]

Previously this'd cause a stack overflow in Cargo later in the compilation
graph, but this is intended to get caught during resolution.

Closes #3831

9 years agoDetect cyclic dependencies through [replace]
Alex Crichton [Mon, 20 Mar 2017 19:43:44 +0000 (12:43 -0700)]
Detect cyclic dependencies through [replace]

Previously this'd cause a stack overflow in Cargo later in the compilation
graph, but this is intended to get caught during resolution.

Closes #3831

9 years agoReport the name of the test that failed (fix #2529)
tee-too [Mon, 20 Mar 2017 10:39:22 +0000 (11:39 +0100)]
Report the name of the test that failed (fix #2529)

9 years agoAuto merge of #3843 - alexcrichton:fix-override-default-features, r=matklad
bors [Sat, 18 Mar 2017 13:01:54 +0000 (13:01 +0000)]
Auto merge of #3843 - alexcrichton:fix-override-default-features, r=matklad

Fix overriding mixing with default features

Previously Cargo had a bug where if a crate *without* a default feature was
overridden with one that did indeed have a default feature then the default may
not end up getting activated by accident. The fix was to avoid returning too
quickly hen activating dependencies until after we've inspected and learned
about replacements.

Closes #3812

9 years agoFix overriding mixing with default features
Alex Crichton [Fri, 17 Mar 2017 23:12:11 +0000 (16:12 -0700)]
Fix overriding mixing with default features

Previously Cargo had a bug where if a crate *without* a default feature was
overridden with one that did indeed have a default feature then the default may
not end up getting activated by accident. The fix was to avoid returning too
quickly hen activating dependencies until after we've inspected and learned
about replacements.

Closes #3812

9 years agoEncourage tools writers to explicitly pin metadata version
Aleksey Kladov [Fri, 17 Mar 2017 15:00:29 +0000 (18:00 +0300)]
Encourage tools writers to explicitly pin metadata version

9 years agoAuto merge of #3839 - tee-too:fix-3828, r=matklad
bors [Fri, 17 Mar 2017 14:02:19 +0000 (14:02 +0000)]
Auto merge of #3839 - tee-too:fix-3828, r=matklad

Remove --cap-lints feature detection (fix issue #3828)

9 years agoRemove --cap-lints feature detection (fix issue #3828)
tee-too [Fri, 17 Mar 2017 13:52:31 +0000 (14:52 +0100)]
Remove --cap-lints feature detection (fix issue #3828)

9 years agoAdd a workspace.exclude key
Alex Crichton [Thu, 16 Mar 2017 21:50:23 +0000 (14:50 -0700)]
Add a workspace.exclude key

This commit adds a new key to the `Cargo.toml` manifest, `workspace.exclude`.
This new key is a list of strings which is an array of directories that are
excluded from the workspace explicitly. This is intended for use cases such as
vendoring where path dependencies into a vendored directory don't want to pull
in the workspace dependencies.

There's a number of use cases mentioned on #3192 which I believe should all be
covered with this strategy. At a bare minimum it should suffice to `exclude`
every directory and then just explicitly whitelist crates through `members`
through inclusion, and that should give precise control over the structure of a
workspace.

Closes #3192

9 years agoAuto merge of #3836 - alexcrichton:bump, r=alexcrichton
bors [Thu, 16 Mar 2017 21:03:56 +0000 (21:03 +0000)]
Auto merge of #3836 - alexcrichton:bump, r=alexcrichton

Bump to 0.19.0